#include <stdio.h>

int main ()
{

    int n , k ;

    float a = 0 , b = 0 , c = 0 , d = 0 ;

    scanf("%d %d" , &n , &k) ;

    for (int i = 1 ; i <= n ; i++)
    {

        if (i % k == 0)
        {

            a += i ;

            b++ ;

        }

        else
        {

            c += i ;

            d++ ;

        }

    }

    float average1 = a / b ;

    float average2 = c / d ;

    printf("%.1lf %.1lf" , average1 , average2) ;

    return 0 ;

}